package main.java.DMDE.model.relationships;

import java.util.UUID;

import main.java.DMDE.model.Diagram;
import main.java.DMDE.model.relationships.strategy.CompositionStrategy;
import main.java.DMDE.styling.StyleConstants;

public class Composition extends Relationship {

    private Direction direction;

    public Composition(RelationshipComponent componentA,
	    RelationshipComponent componentB,UUID id) {
	super(componentA, componentB,id);
	linkName = StyleConstants.RELATIONSHIP_LINK_COMPOSITION_STYLE;
    }

    public Composition(Diagram diagram,UUID id) {
	super(id);
	this.validationStrategy = new CompositionStrategy(diagram);
	linkName = StyleConstants.RELATIONSHIP_LINK_COMPOSITION_STYLE;
    }

    public Composition(Diagram diagram) {
    	validationStrategy = new CompositionStrategy(diagram);
    	linkName = StyleConstants.RELATIONSHIP_LINK_COMPOSITION_STYLE;
   	}

	@Override
    public void setDirection(Direction direction) {
	if (!direction.equals(Direction.BOTH))
	    this.direction = direction;
    }

    @Override
    public Direction getDirection() {
	return direction;
    }

    @Override
    public RelationshipTypes getType() {
	return RelationshipTypes.Composition;
    }

}
